# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer:
pkgname=thin-provisioning-tools
pkgver=1.0.9
pkgrel=0
pkgdesc="suite of tools for manipulating the metadata of the dm-thin device-mapper target"
url="https://github.com/jthornber/thin-provisioning-tools"
# ucontext libc fs_type_t
arch="all !s390x"
license="GPL-3.0-or-later"
makedepends="cargo gawk cargo-auditable"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/jthornber/thin-provisioning-tools/archive/v$pkgver.tar.gz"
# tests do a ton of disk i/o for a while..
# they pass on x86_64, but a bit too destructive to constantly run
options="net !check"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --release --frozen
}

check() {
	cargo test --locked
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
c7d137b82cce4286d43f49af039f8026d7d7746e96affebc82e8243173ba9a014e3b462fc4b55850067ecfbcc6113c49f009c1285e272a4d64455715d11a9da1  thin-provisioning-tools-1.0.9.tar.gz
"
